<!DOCTYPE html>
<html lang="en"  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <link rel="shortcut icon"  th:href="@{/chqimage/favicon.ico}" type="image/x-icon">
    <title>调解详情</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <link rel="stylesheet" th:href="@{/m-css/m-casedetail.css}">
    <script type="text/javascript" th:src="@{/chqjs/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/chqjs/vue.min.js}"></script>
</head>
<body>
<!--顶部标题-->
<div id="head">
    <a href="#" class="return_img float_left"><img src="/m-image/icon-fanhui.png" alt=""></a>
    <p class="head_title">调解详情</p>
</div>
<div id="casedetail_box">
    <!--纠纷事项-->
    <div class="ca_case">
        <div class="user">
            <p class="float_left">原告：<span class="ca_ygName">{{case_detail.userName}}</span></p>
            <p class="float_left">手机号码：<span class="ca_ygTel">{{case_detail.userTel}}</span></p>
        </div>
        <div class="dsr" v-for="dsr in dsrs">
            <p class="float_left">被告：<span class="ca_bgName">{{dsr.dsrName }}</span></p>
            <p class="float_left">手机号码：<span class="ca_bgTel">{{dsr.dsrTel}}</span></p>
        </div>
        <div class="jfcontent">纠纷事项：
            <span class="ca_jfcase">{{case_detail.details}}</span>
        </div>
    </div>
    <!--申请相关-->
    <div class="ca_other">
        <p>申请人：<span>{{case_detail.userName}}</span></p>
        <p>申请时间：<span>{{case_detail.create_date}}</span></p>
        <p>申请来源：<span>{{case_detail.from_where}}</span></p>
        <p>受理时间：<span>2017-12-18</span></p>
    </div>
    <!--调解结果-->
    <div class="ca_detail">
        <div class="ca_detail_diary" @click="toPage(0)">调解日志</div>
        <div class="ca_detail_result" @click="toPage(1)">调解结果</div>
    </div>
</div>
<script>
    new Vue({
        el:'#casedetail_box',
        data:{
            case_detail:{},
            dsrs:{}
        },
        mounted:function () {
            //获取URL参数，即 当前按键id
            var location = window.location.href;
            var href= location+"";
            var href_part=href.split('?');
            var case_id=(href_part[1])*1;
            var _that = this;
            $.ajax({
                url:'/mediator/caseDetail?case_id='+case_id,
                type:'get',
                datatype:'json',
                success:function (result) {
                    _that.case_detail = result;
                    _that.dsrs = result.dsrs;
                    console.log(_that.case_detail);
                },
                error:function (err) {
                    console.log(err);
                }
            })
        },
        methods:{
            toPage:function (i) {
               var case_id = this.case_detail.case_Id;
               console.log(case_id);
               if(i == 0){
                   window.location.href = '/mediator/to_diary?'+case_id;
               }else{
                    window.location.href = '/mediator/to_result?'+case_id;
                }
            }
        }
    })
</script>

</body>
</html>